The present disclosure relates to chroma keying. Chroma keying is used in many applications to identify foreground regions and background regions in an input image. Chroma keying is also referred to as “color keying” or “color-separation overlay” (CSO). Chroma keying is typically applied to images of foreground objects (e.g., a person) in front of a backdrop having a single color or a relatively narrow range of colors. For example, in television broadcasts, a weather reporter often stands in front of a blue or green screen, and chroma keying is used to replace the blue or green screen with a weather map. The backdrop is commonly blue or green because those colors tend not to be found in skin tones. Chroma keying typically generates a foreground image and an alpha channel. The foreground image portrays the foreground objects, but with the blue or green backdrop substantially removed from the image. The alpha channel specifies the transparency and/or opacity of different regions of the foreground image. When the foreground image is combined with a replacement background, the alpha channel can be used to determine where the replacement background is visible, partially visible, or invisible in the combined image.